package com.um.jdy.platform.alarm.controller;

import com.um.jdy.platform.alarm.entity.dto.AlarmRulePageDTO;
import com.um.jdy.platform.alarm.manager.AlarmRuleManager;
import com.um.jdy.common.alarm.entity.dto.AlarmRuleDTO;
import com.um.jdy.common.alarm.entity.po.AlarmRule;
import com.um.jdy.common.alarm.entity.vo.AlarmRuleVO;
import com.um.jdy.common.alarm.service.AlarmRuleService;
import com.um.springboot.starter.annotation.ApiPermission;
import com.um.springboot.starter.annotation.LoginRequired;
import com.um.springboot.starter.entity.Page;
import com.um.springboot.starter.orm.controller.BasePlusController;
import com.um.springboot.starter.orm.entity.Response;
import com.um.springboot.starter.orm.params.ListDTO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 控制器：告警规则
 */
@RestController
@RequestMapping("/api/v1/cms/alarm/rule")
@Api(tags = "告警规则", description = "告警规则")
@ApiPermission("alarm_rule")
@LoginRequired
public class AlarmRuleController extends BasePlusController<AlarmRuleManager, AlarmRuleService, AlarmRule, AlarmRuleDTO, AlarmRuleVO, AlarmRulePageDTO, ListDTO> {

    /**
     * 查询分页
     * @param params
     * @return
     */
    @ApiPermission("page")
    @ApiOperation(value = "分页告警规则")
    @PostMapping("/get_page")
    public Response<Page<AlarmRule>> getRecordPage(@RequestBody AlarmRulePageDTO params){
        return manager.page(params);
    }
}
